<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="web" uri="http://meerkat.qunar.com/web"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<web:designCss/>
    <link rel="stylesheet" type="text/css" href="/resources/css/jquery-ui-1.8.13.custom.css"/>
<%@include file="/WEB-INF/include/head.jsp" %>
<script src="${PATH}resources/js/fw/app/qadmin.app.user.js?v=<%@include file="/WEB-INF/version.jsp" %>"></script>
<script src="${PATH}resources/js/fw/app/qadmin.app.optlog.js?v=<%@include file="/WEB-INF/version.jsp" %>"></script>
</head>
<body>
    <div class="wrapper">
        <form name="search" action="${PATH}user/list.htm">
        <web:titleBar title="查询条件" />
        <div class="main content">
                <table>
                    <tr>
                    <td>用户名</td>
                    <td><input type="text" id="name" name="name" value="${name}" /></td>
                    <td><input type="submit" class="button button-blue" value="检索" /></td>
                    </tr>
                </table>

        </div>

        <web:titleBar title="账户列表" />
        <div class="main content">
            <table class="list" cellpadding="1" cellspacing="1">
                <tr>
                    <th>ID</th>
                    <th>用户名</th>
                    <th>真实姓名</th>
                    <th>部门</th>
                    <th>邮箱</th>
                    <th>用户来源</th>
                    <th>状态</th>
                    <th>最后登陆时间</th>
                    <th>操作</th>
                </tr>
                <c:forEach var="user" items="${lstObj.userBeans}">
                <tr>
                    <td>${user.id}</td>
                    <td>${user.name}</td>
                    <td>${user.realname}</td>
                    <td>${user.department}</td>
                    <td>${user.email}</td>
                    <td>
            	    <c:choose>
            	      <c:when test="${user.authType==0}">SSO</c:when>
            	      <c:when test="${user.authType==1}">密码用户</c:when>
            	      <c:otherwise>未知</c:otherwise>
            	    </c:choose>
                    </td>
                    <td>
            	    <c:choose>
            	      <c:when test="${user.status==0}">锁定</c:when>
            	      <c:when test="${user.status==1}">正常</c:when>
            	      <c:otherwise>状态异常</c:otherwise>
            	    </c:choose>
                    </td>
                    <td>${user.lastLoginTime}</td>
                    <td>
                        <a href="#" onclick="Qadmin.App.User.updateUser(${user.id});">更新</a> |
            	    <c:choose>
            	      <c:when test="${user.status==0}">
            		  <a href="#" onclick="Qadmin.App.User.unLockUser(${user.id});">解锁</a> |
            	      </c:when>
            	      <c:when test="${user.status==1}">
            		  <a href="#" onclick="Qadmin.App.User.lockUser(${user.id});">锁定</a> |
            	      </c:when>
            	    </c:choose>
                        <a href="#" onclick="Qadmin.App.User.deleteUser(${user.id});"  style="color:red;">删除</a> |
            	    <a href="#" onclick="Qadmin.App.OptLog.showSingleUserOptLog(${user.id});">操作日志</a>
                    </td>
                </tr>
                </c:forEach>
                <c:if test="${fn:length(lstObj.userBeans) == 0}">
                    <tr>
                        <td colspan="9">没有找到记录</td>
                    </tr>
                </c:if>
                <tr>
                    <td colspan="9" style="text-align:right;">
                    <web:pageLinks
                                name="lstObj"
                                form="search"
                                submit="true"
                                rowProperty="row"
                                totalProperty="totalCount"
                                indexProperty="startIndex"/>
                    <span>${currentPageIndex}</span>
                    /
                    <span>${totalPageCount}</span>
                    <span>(${lsbObj.totalCount})</span>
                    </td>
                </tr>
            </table>
        </div>
        </form>
    </div>
    
   
</body>
</html>